home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1988 / Aug-Sep 88 / Response to How to hier-menus? < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.4 KB  |  98 lines  |  [TEXT/GEOL]

  1. Item    7757614                         19-Sept-88        11:21
  2.  
  3. From:   D0795                           Double Centre Surveying, Dev
  4.  
  5. To:     D1032                           Softview, Dev, Ron Breger
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Response to How to hier-menus?
  10.  
  11. Leslie R. Lee, SoftView, Inc.
  12. D1032
  13.  
  14. Leslie,
  15.  
  16. The only difference is in the resource file actually. I am providing pieces
  17. only. You should be able to get the idea here or look at demoText. This rsrc is
  18. for use in a 1.1.1 program but should work fine in a 2.xxbx program.
  19.  
  20. You must first tell rez and postRez that it is going to be hier:
  21.  
  22. resource 'cmnu' (4) {
  23.    4,
  24.    textMenuProc,
  25.    allEnabled,
  26.    enabled,
  27.    "Design",
  28.     {  /* array: 4 elements */
  29.    /* [1] */
  30.    "Points", noIcon, parent, "\0x13"/*19 hex*/, plain, 1905; /* cPointSubMenu *
  31.    /* [2] */
  32.    "Lines", noIcon, parent, "\0x14"/*20 hex*/, plain, 1906; /* cLineSubMenu */
  33.    /* [3] */
  34.    "Curves", noIcon, parent, "\0x15"/*21 hex*/, plain, 1907; /* cCurveSubMenu *
  35.    /* [4] */
  36.    "Boundaries", noIcon, parent, "\0x16"/*22 hex*/, plain, 1908; /*
  37. cBoundarySubMenu */
  38.    /* [5] */
  39.    "Display angle…", noIcon, "B", noMark, plain, 1620
  40.    }
  41. };
  42.  
  43. I defined parent as follows:
  44. /* parent of a sub-menu */
  45. #define parent  "\0x1B"
  46.  
  47. Then you must supply the submenu:
  48. resource 'cmnu' (20) {
  49.    20,
  50.    textMenuProc,
  51.    allEnabled,
  52.    enabled,
  53.    "Lines",
  54.     {  /* array: 4 elements */
  55.    /* [1] */
  56.    "Connect with line", noIcon, "L", noMark, plain, 1458;
  57.    /* [2] */
  58.    "Reverse direction", noIcon, "R", noMark, plain, 1483;  /* cSwapLineEndpoint
  59.    /* [3] */
  60.    "Line thickness…", noIcon, noKey, noMark, plain, 1482;  /*
  61. cChangeLineCurveDrawThickness*/
  62.    /* [4] */
  63.    "Make default line", noIcon, noKey, noMark, plain, 1612
  64. /*cMakeThisTheDefaultLine*/
  65.    }
  66. };
  67.  
  68. Then you must tell it how your MenuBar is to be setUp:
  69.  
  70. /* Menu bar for a non-color system */
  71. resource 'MBAR' (131) {
  72.    {1; 2; 3; 4; 5; 6; 7; 30; 31}
  73. };
  74.  
  75. /* Menu bar for a non-color system */
  76. resource 'MBAR' (132) {
  77.    {1; 2; 3; 4; 5; 6; 7; 30}
  78. };
  79.  
  80. /* Dynamic menus */
  81. resource 'MBAR' (129) {
  82.    {32 }
  83. };
  84.  
  85. /* Hierarchial Sub-Menus */
  86. resource 'MBAR' (130) {
  87.    {11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22}
  88. };
  89.  
  90. This previous step is the most likely forgotten. Also, don't forget to enable
  91. its items individually. Nothing special here.
  92.  
  93. Good luck,
  94.  
  95. John D. Olsen, RPS
  96.  
  97.  
  98.